home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / sgml / unix / sgmlh / sgmlxtrn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-03  |  10.2 KB  |  148 lines

  1. /******************************************************************************/
  2. /* Defined extettab to support external data entities.                        */
  3. /******************************************************************************/
  4. /* SGMLXTRN.H: External declarations for SGML public variables.
  5.                Exceptions: Constants lex????? and del????? are defined in
  6.                LEX?????.C modules; constants pcb????? are defined in PCB?????.c.
  7. */
  8. /******************************************************************************/
  9. #ifndef SGMLXTRN              /* Don't include this file more than once. */
  10. #define SGMLXTRN
  11. /******************************************************************************/
  12. /* Variables to be initialized each pass (except first, which is done by C).
  13. */
  14. extern int badresw;           /* 1=REF_ out of context; 0=valid. */
  15. extern int charmode;          /* >0=in #CHARS; 0=not. */
  16. extern int conactsw;          /* 1=return saved content action 0=get new one.*/
  17. extern int conrefsw;          /* 1=content reference att specified; 0=no. */
  18. extern int contersv;          /* Save contersw while processing pending REF. */
  19. extern int contersw;          /* 1=element or #CHARS out of context; 0=valid. */
  20. extern int datarc;            /* Return code for data: DAF_ or REF_. */
  21. extern int delmscsw;          /* 1=DELMSC must be read on return to es==0. */
  22. extern int didreq;            /* 1=required implied tag processed; 0=no. */
  23. extern int dostag;            /* 1=retry newetd instead of parsing; 0=parse. */
  24. extern int dtdsw;             /* DOCTYPE declaration found: 1=yes; 0=no. */
  25. extern int entdatsw;          /* 2=CDATA entity; 4=SDATA; 8=NDATA; 0=none. */
  26. extern int entpisw;           /* 4=PI entity occurred; 0=not. */
  27. extern int eodsw;             /* 1=eod found in error; 0=not yet. */
  28. extern int eofsw;             /* 1=eof found in body of document; 0=not yet. */
  29. extern int es;                /* Index of current source in stack. */
  30. extern int etagimct;          /* Implicitly ended elements left on stack. */
  31. extern int etagimsw;          /* 1=end-tag implied by other end-tag; 0=not. */
  32. extern int etagmin;           /* Minim: NONE NULL NET DATA; implied by S/ETAG*/
  33. extern int etictr;            /* Number of "NET enabled" tags on stack. */
  34. extern int etisw;             /* 1=tag ended with eti; 0=did not. */
  35. extern int indtdsw;           /* Are we in the DTD? 1=yes; 0=no. */
  36. extern int mslevel;           /* Nesting level of marked sections. */
  37. extern int msplevel;          /* Nested MS levels subject to special parse. */
  38. extern int newdtdsw;          /* 1=DTD just started; 0=DTD returned to TP. */
  39. extern int prologsw;          /* 1=in prolog; 0=not. */
  40. extern int pss;               /* SGMLACT: scbsgml stack level. */
  41. extern int sgmlsw;            /* SGML declaration found: 1=yes; 0=no. */
  42. extern int stagmin;           /* Minimization: NONE, NULL tag, implied by STAG*/
  43. extern int tagctr;            /* Tag source chars read. */
  44. extern int ts;                /* Index of current tag in stack. */
  45. extern struct parse *propcb;  /* Current PCB for prolog parse. */
  46. /******************************************************************************/
  47. /* Variables that do not require general initialization each pass, because
  48.    they (1) contain values that are set in the first pass and used in all of
  49.    them, or (2) are initialized (if necessary) by the functions that use them.
  50. */
  51. extern int aentctr;           /* Number of ENTITY tokens in this att list. */
  52. extern int conact;            /* Return code from content parse. */
  53. extern int conrefsv;          /* Save conrefsw when doing implied start-tag.*/
  54. extern int dtdrefsw;          /* External DTD? 1=yes; 0=no. */
  55. extern int etiswsv;           /* Save etisw when processing implied start-tag.*/
  56. extern int grplvl;            /* Current level of nested grps in model. */
  57. extern int idrctr;            /* Number of IDREF tokens in this att list. */
  58. extern int mdessv;            /* ES level at start of markup declaration. */
  59. extern int notadn;            /* Position of NOTATION attribute in list. */
  60. extern int parmno;            /* Current markup declaration parameter number. */
  61. extern int pass;              /* 0=first pass over file; >0=later passes. */
  62. extern int pexsw;             /* 1=tag valid solely because of plus exception.*/
  63. extern int rcessv;            /* ES level at start of RCDATA content. */
  64. extern int tagdelsw;          /* 1=tag ended with delimiter; 0=no delimiter. */
  65. extern int tokencnt;          /* Number of tokens found in attribute value. */
  66. extern long idrefl;           /* Existence bits: IDREF atts (in same order). */
  67. extern struct entity *ecbdeflt;  /* #DEFAULT ecb (NULL if no default entity). */
  68. extern struct etd *docetd;    /* The etd for the document as a whole. */
  69. extern struct etd *etagreal;  /* Actual or dummy etd that implied this tag. */
  70. extern struct etd *newetd;    /* The etd for a start- or end-tag recognized. */
  71. extern struct etd *nextetd;   /* ETD that must come next (only one choice). */
  72. extern struct etd *stagreal;  /* Actual or dummy etd that implied this tag. */
  73. extern struct parse *conpcb;  /* Current PCB for content parse. */
  74. extern UNCH *antvptr;         /* Name token value returned by antvget. */
  75. extern UNCH *data;            /* Pointer to returned data in buffer. */
  76. extern UNCH *mdname;          /* Name of current markup declaration. */
  77. extern UNCH *ptcon;           /* Current pointer into tbuf. */
  78. extern UNCH *ptpro;           /* Current pointer into tbuf. */
  79. extern UNCH *pvalptr;         /* Pointer to parsed attribute value. */
  80. extern UNCH *rbuf;            /* DOS file read area (including RCC buffer). */
  81. extern UNCH *rbufs;           /* DOS file read area: start position for read. */
  82. extern UNCH *subdcl;          /* Subject of markup declaration (e.g., GI). */
  83. extern UNCH Tstart;           /* Save starting token for AND group testing. */
  84. extern UNS conradn;           /* 1=CONREF attribute in list (0=no). */
  85. extern UNS datalen;           /* Length of returned data in buffer. */
  86. extern UNS entlen;            /* Length of TAG or EXTERNAL entity text. */
  87. extern UNS idadn;             /* Number of ID attribute (0 if none). */
  88. extern UNS noteadn;           /* Number of NOTATION attribute (0 if none). */
  89. extern UNS pifldlen;          /* Length of field in public identifier (EOS). */
  90. extern UNS reqadn;            /* Num of atts with REQUIRED default (0=none). */
  91. /******************************************************************************/
  92. /* Variable arrays and structures: initialization not required for each pass.
  93. */
  94. extern char ntoabuf[];        /* Buffer for returned string. */
  95. extern int *tprc;             /* Pointer to text processor return code holder.*/
  96. extern UNIV *tprcbp;          /* Pointer to text processor rcb pointer. */
  97. extern struct ad al[];        /* Current attribute list work area. */
  98. extern struct dcncb *dcntab[];/* List of data content notation names. */
  99. extern struct entity *aentl[];/* ECBs for AENTITY tokens in an att list.*/
  100. extern struct entity *etab[]; /* Entity hash table. */
  101. extern struct etd *etdtab[];  /* Element type definition hash table. */
  102. extern struct fpi fpidf;      /* Fpi for #DEFAULT entity. */
  103. extern struct id *itab[];     /* Unique identifier hash table. */
  104. extern struct ipberr ie;      /* IPB: From SGML for error handling services. */
  105. extern struct ipbfile io;     /* IPB: file I/O services from text processor. */
  106. extern struct ipbmem im;      /* IPB: memory services from text processor. */
  107. extern struct rcbdata rcbdaf; /* RCB: data, record end, pi, eod. */
  108. extern struct rcbtag rcbetag; /* RCB: end-tag. */
  109. extern struct rcbtag rcbstag; /* RCB: start-tag. */
  110. extern struct restate scbsgml[];  /* SGMLACT: return action state stack. */
  111. extern struct source scbs[];  /* Stack of open sources ("SCB stack"). */
  112. extern struct srh *srhtab[];  /* List of SHORTREF table headers. */
  113. extern struct stat ds;        /* Document statistics. */
  114. extern struct switches sw;    /* Parser control switches set by text proc. */
  115. extern struct tag tags[];     /* Stack of open elements ("tag stack"). */
  116. extern struct thdr gbuf[];    /* Buffer for creating group. */
  117. extern struct thdr prcon[];   /* 0-2: Model for *DOC content. */
  118. extern struct thdr undechdr;  /* 0: Default model hdr for undeclared content. */
  119. extern UNCH dtype[];          /* Document type name. */
  120. extern UNCH entbuf[];         /* Buffer for entity reference name. */
  121. extern UNCH fce[];            /* String form of FCE char (fce[1] must be EOS).*/
  122. extern UNCH nonchbuf[];       /* Buffer for valid nonchar character reference.*/
  123. extern UNCH tbuf[];           /* Work area for tokenization. */
  124. extern UNCH *lbuf;            /* In tbuf: Literal parse area; TAGLEN limit.*/
  125. /******************************************************************************/
  126. /* Constants.
  127. */
  128. extern int scbsgmnr;          /* SCBSGML: new record; do not ignore RE. */
  129. extern int scbsgmst;          /* SCBSGML: trailing stag or markup; ignore RE. */
  130. extern struct map dctab[];    /* Keywords for declared content parameter. */
  131. extern struct map deftab[];   /* Default value keywords. */
  132. extern struct map dvtab[];    /* Declared value: keywords and type codes.*/
  133. extern struct map enttab[];   /* Entity declaration second parameter. */
  134. extern struct map exttab[];   /* Keywords for external identifier. */
  135. extern struct map extettab[]; /* Keywords for external entity type. */
  136. extern struct map funtab[];   /* Function character reference names. */
  137. extern struct map mstab[];    /* Marked section keywords. */
  138. extern struct map pubcltab[]; /* Keywords for public text class. */
  139. extern UNCH indefent[10];     /* Internal name: default entity name. */
  140. extern UNCH indefetd[10];     /* Internal name: default document type. */
  141. extern UNCH indocent[10];     /* Internal name: SGML document entity. */
  142. extern UNCH indocetd[6];      /* Internal name: etd for document as a whole. */
  143. extern UNCH indtdent[9];      /* Internal name: external DTD entity. */
  144. extern UNCH license[297];     /* SGML Users' Group free license. */
  145. /******************************************************************************/
  146. #endif /* ndef SGMLXTRN */
  147. /******************************************************************************/
  148.